﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Sims3Package.Wrapper;
using System.IO;

namespace PackageEditor.Helper
{
    public partial class OBJKHelper : Form
    {
        OBJKResourceWrapper w;
        public OBJKHelper(Stream s)
        {
            InitializeComponent();
            w = new OBJKResourceWrapper(s);
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
        }

        private void OBJKHelper_Load(object sender, EventArgs e)
        {

        }

        public class CustomControl : Control
        {
            public Label lbl { get; set; }
            public TextBox txtBox { get; set; }
            public CheckBox ckb { get; set; }
            public CustomControl(string Name, bool enabled, OBJKResourceWrapper.Component type)
            {
                this.lbl = new Label();
                lbl.Text = Name;
                lbl.Name = "lbl" + Name;
                txtBox = new TextBox();
                txtBox.Name = "txt" + Name;
                ckb.Text = Name;
                ckb.Checked = enabled;

            }
        }


        private Control GetControl(string Name)
        {
            Control[] control = this.Controls.Find(Name, true);
            return control.Length == 1 ? control[0] : null;
        }
    }
}
